<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
	<!-- import css and js --> 
	<%@ include file="/common/metaInput.jsp" %>  
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
var basic_Url="${ctx}/yd/logic/poreturn";
var grid;
var url;
$(function(){
	
	var column1 = [
				{ display: '操作',width: 30,
				    render: function (record, rowindex, value, column) {
				  	  var rc = JSON.stringify(record);
				  	  if(record.openBatch=='Y'){
				  		 return "<a href='javascript:ItemWindow("+rc+","+rowindex+")'><img src='${ctx}/js/ligerUI/skins/icons/add.gif' alt='添加' /></a>";
				  	  }else{
				  		 return "<h1>+</h1>";
				  	  }
					  }},
					  { display: 'id', name: 'id', width: 1 ,hide:true},
					  { display: 'materialsid', name: 'materialsid', width: 1,hide:true },
					  { display: '<font color="gray">物料编码</font>', name: 'code', width: 120,
						  render: function (record, rowindex, value, column) {
							  var rc = JSON.stringify(record);
							  if(record.openBatch=='Y'){
								  return "<a href='javascript:ItemWindow("+rc+","+rowindex+")'>"+record.code+"</a>";
							  	  }else{
							  		 return record.code;
							  	  }
						  	  
						  }},
	                  { display: '<font color="gray">物料名称</font>', name: 'name', width: 150 },
	                  { display: '<font color="gray">单位</font>', name: 'unit', width: 120},
	                  { display: '<font color="gray">物料是否可用批次</font>', name: 'openBatch' ,hide:true,width: 150, render: function (item, rowindex, value, column)
						    {
		            	   	if(item.openBatch=="Y"){
		            	   		return "可用";
		            	   	}else{
		            	   		return "不可用";
		            	   	}
					   		
				    }},
	                  { display: '<font color="gray">订单数量</font>', name: 'quantity', width: 120},
	                  { display: '<font color="gray">基本单位</font>', name: 'junit', width: 120},
	                  { display: '<font color="gray">基本单位订单数量</font>', name: 'jquantity', width: 120},
	                  { display: '<font color="gray">型号规格</font>', name: 'spec', width: 245},
	                  { display: '<font color="gray">基本单位单价</font>', name: 'price', width: 120},
// 	                  { display: '<font color="gray">批次</font>', name: 'batch', width: 120},
	                  { display: '<font color="gray">物料状态</font>', name: 'state', width: 120,
	                	  render: function (item){
	                		  var state=item.state;
	                		  if(state=="1"){
	                			  return "一等";
	                		  }
	                		  if(state=="2"){
	                			  return "次货";
	                		  }
	                		  if(state=="3"){
	                			  return "旧件";
	                		  }
	                	  }},
	                  { display: '<font color="gray">(基本单位)入库总数量</font>', name: 'jhealthycount', width: 120},
	                  { display: '<font color="gray">入库总数量</font>', name: 'healthycount', width: 120},
	                  { display: '<font color="gray">基本单位已退货数量</font>', name: 'jbadCount', width: 120},
	                  { display: '<font color="gray">已退货数量</font>', name: 'badcount', width: 120},
	                  { display: '<font color="gray">基本单位退货数量</font>', name: 'jreturnquantity', width: 120},
	                  { display: '退货数量<font color="red">*</font>', name: 'returnquantity', width: 120
	                	  ,editor: { type: 'float'},render:function(item){
	                		  if(item.openBatch=="Y"){
			            	   		item.returnquantity=item.val;
			            	   	}else{
			            	   	 if(item.returnquantity!=''&&item.returnquantity!=null&&item.unitconvert!=null&&item.unitconvert!=''){
			                		  grid.updateCell('jreturnquantity', (item.returnquantity*(item.unitconvert)).toFixed(4), item);
			            	   		}
	               				}
	                	  return  (item.returnquantity==undefined ? 0:parseFloat(item.returnquantity).toFixed(4));
	                	  }
	                       	
	                  },
	           { display: '<font color="gray">单位换算率</font>', name: 'unitconvert', width: 120},
	           { display: '<font color="gray">值</font>', name: 'val' ,width:1,hide:1},
	           { display: '<font color="gray">批次信息</font>', name: 'itemBatch', hide:true,width: 1},
	           { display: '<font color="gray">修改状态</font>', name: 'updstatus', hide:true,width: 1}
	                  ];
	var column2 = [
					  { display: '操作',width: 30,
				    render: function (record, rowindex, value, column) {
				  	  var rc = JSON.stringify(record);
				  	  if(record.openBatch=='Y'){
				  		 return "<a href='javascript:ItemWindow("+rc+","+rowindex+")'><img src='${ctx}/js/ligerUI/skins/icons/add.gif' alt='添加' /></a>";
				  	  }else{
				  		 return "<h1>+</h1>";
				  	  }
					  }},
					  { display: 'id', name: 'id', width: 1 ,hide:true},
					  { display: 'materialsid', name: 'materialsid', width: 1,hide:true },
					  { display: '<font color="gray">物料编码</font>', name: 'code', width: 120,
						  render: function (record, rowindex, value, column) {
							  var rc = JSON.stringify(record);
							  if(record.openBatch=='Y'){
								  return "<a href='javascript:ItemWindow("+rc+","+rowindex+")'>"+record.code+"</a>";
							  	  }else{
							  		 return record.code;
							  	  }
						  	  
						  }},
	                  { display: '<font color="gray">物料名称</font>', name: 'name', width: 150 },
	                  { display: '<font color="gray">单位</font>', name: 'unit', width: 120},
	                  { display: '<font color="gray">物料是否可用批次</font>', name: 'openBatch' ,width: 150,hide:true, render: function (item, rowindex, value, column)
						    {
		            	   	if(item.openBatch=="Y"){
		            	   		return "可用";
		            	   	}else{
		            	   		return "不可用";
		            	   	}
					   		
				    }},
	                  { display: '<font color="gray">订单数量</font>', name: 'quantity', width: 120},
	                  { display: '<font color="gray">基本单位</font>', name: 'junit', width: 120},
	                  { display: '<font color="gray">基本单位订单数量</font>', name: 'jquantity', width: 120},
	                  { display: '<font color="gray">型号规格</font>', name: 'spec', width: 245},
	                  { display: '<font color="gray">基本单位单价</font>', name: 'price', width: 120},
// 	                  { display: '<font color="gray">批次</font>', name: 'batch', width: 120},
	                  { display: '<font color="gray">物料状态</font>', name: 'state', width: 120,
	                	  render: function (item){
	                		  var state=item.state;
	                		  if(state=="1"){
	                			  return "一等";
	                		  }
	                		  if(state=="2"){
	                			  return "次货";
	                		  }
	                		  if(state=="3"){
	                			  return "旧件";
	                		  }
	                	  }},
	                  { display: '<font color="gray">(基本单位)入库总数量</font>', name: 'jhealthycount', width: 120},
	                  { display: '<font color="gray">入库总数量</font>', name: 'healthycount', width: 120},
	                  { display: '<font color="gray">基本单位已退货数量</font>', name: 'jbadCount', width: 120},
	                  { display: '<font color="gray">已退货数量</font>', name: 'badcount', width: 120},
	                  { display: '<font color="gray">基本单位退货数量</font>', name: 'jreturnquantity', width: 120},
	                  { display: '退货数量<font color="red">*</font>', name: 'returnquantity', width: 120},
	                  { display: '<font color="gray">单位换算率</font>', name: 'unitconvert', width: 120},
	                  { display: '<font color="gray">值</font>', name: 'val' ,width:1,hide:1},
	                  { display: '<font color="gray">批次信息</font>', name: 'itemBatch',hide:true, width: 1},
	                  { display: '<font color="gray">修改状态</font>', name: 'updstatus', hide:true,width: 1}
	                  ];
	 var column3 = column1;                 
	    if('${poreturn.billstatus}' != "" && '${poreturn.billstatus}' != "0"){
	    	column3 = column2;    
	    }
	
	grid = $("#table1").ligerGrid({
        columns: 
				  column3,
                  enabledEdit: true,
                  usePager: true,pageSize:1000,pageSizeOptions:[1000],
                  width: "100%", height:300, checkbox: true,
                  parms:[{ name : 'id' , value : '${poreturn.id}'}],
                  url : basic_Url+"/griditems.do",
                  toolbar: { items: [
                                     { text: '删除', click: deleteRow, img: '${ctx}/js/ligerUI/skins/icons/delete.gif' }
                                     ]
                                     }
                  });
	$("#pageloading").hide();
	
	$("#inputForm").validate({			   
	onsubmit: true,
	 /*执行ajaxsubmit  */ 
    submitHandler: function(editform) {
        try{			    		
            url =  basic_Url+"/save.do";
            var api = frameElement.api;
        	var W = api.opener;
            getReturnMessage(url,"inputForm",W.searchAP);
        }catch(e){alert(e)}
    }
	});

	
	
	$("#storage").change(function(){ 
		  $("#whcode").val($("#storage").val());
		  $("#whname").val($("#storage").find("option:selected").text());
	}); 
	
	$("#pocode").change(function(){ 
		$.ajax({
	      url: "${ctx}/yd/logic/poreturn/warelist.do",
	      global: false,
	      type: "POST",
	      dataType: "json",
	      data: ({
	    	  pocode : $("#pocode").val()
	      }),		     
	      success: function(msg){
	    	  $("#powarecode").html("<option></option>");
	    	  if (msg != null && msg.length >= 1){
	    		  for (var i = 0; i <msg.length; i++){
	    				  $("#powarecode").html($("#powarecode").html() + "<option id='"+msg[i].id+"' value='"+msg[i].powarecode+"'>"+msg[i].powarecode+"</option>");
	    		  }
	    	  }
	    	 
	   }
	});
	}); 
	
	$("#powarecode").change(function(){ 
		multipleSearch("#table1",true,"",basic_Url+"/applyitemlist.do?id="+$("#powarecode").find("option:selected").attr("id"));
		$.ajax({
		      url: "${ctx}/yd/logic/poreturn/warewh.do",
		      global: false,
		      type: "POST",
		      dataType: "json",
		      data: ({
		    	  code : $("#powarecode").find("option:selected").attr("id")
		      }),		     
		      success: function(msg){
		    	  	$("#"+msg.whcode).attr("selected","selected");
		    		$("#whcode").val(msg.whcode);
		   		  	$("#whname").val(msg.whname)
		   		  	$("#spcode").val(msg.spcode);
		   		  	$("#spname").val(msg.spname);
		   		  	$("#batch").val(msg.batch);
		   			$("#createname").val(msg.createname);
		   }
		}); 
	});
	
	if('${poreturn.billstatus}' != "" && '${poreturn.billstatus}' != "0"){
    	$("input").attr("readonly","readonly");
		$("input").attr("onclick","");
		$("select").attr("disabled","disabled");    
    }
	
	if('${poreturn.billstatus}' == ""){
		$("#save1").hide();//禁用保存按钮
		$("#save2").hide();//禁用保存按钮
		$("#save3").hide();//禁用保存按钮
		$("#bohui").hide();
		$("#savej2").hide();
	}
	else if('${poreturn.billstatus}' == "0" ){
		if('${user.name}' != '${poreturn.dcruser}'){
			$("#save1").hide();
		}
		$("#save").hide();//禁用保存按钮
		$("#save2").hide();//禁用保存按钮
		$("#save3").hide();//禁用保存按钮
		$("#bohui").hide();
		$("#savej2").hide();
	}
	else if('${poreturn.billstatus}' == "1" ){
		$("#save1").hide();//禁用保存按钮
		$("#save").hide();//禁用保存按钮
		$("#save3").hide();//禁用保存按钮
	}
	else if('${poreturn.billstatus}' == "2"){
		$("#save1").hide();//禁用保存按钮
		$("#save2").hide();//禁用保存按钮
		$("#save").hide();//禁用保存按钮
		$("#savej2").hide();
	}
	else{
		$("#save").hide();//禁用保存按钮
		$("#save1").hide();//禁用保存按钮
		$("#save2").hide();//禁用保存按钮
		$("#save3").hide();//禁用保存按钮
		$("#bohui").hide();
		$("#savej2").hide();
	}
	
	/* <c:forEach items='${returnitem}' var='item'>
    	var manager = $("#table1").ligerGetGridManager();
    	manager.addRow2({
    		id : "${item.id}",
    		materialsid: "${item.materialsid}",
    		code: "${item.code}",
    		name: "${item.name}",
    		unit : "${item.unit}",
    		quantity : "${item.quantity}",
    		junit : "${item.junit}",
    		jquantity : "${item.jquantity}",
    		spec: "${item.spec}",
    		price: "${item.price}",
    		batch: "${item.batch}",
    		state: "${item.state}",
    		jhealthycount : "${item.jhealthycount}",
    		healthycount : "${item.healthycount}",
    		jbadCount : "${item.jbadCount}",
    		badcount : "${item.badcount}",
    		jreturnquantity : "${item.jreturnquantity}",
    		returnquantity : "${item.returnquantity}",
    		unitconvert : "${item.unitconvert}",
    		itemBatch:'${item.itemBatch}',
    		updstatus : "${item.updstatus}",
    		openBatch: "${item.openBatch}",
    		val : "${item.val}"
        });
    </c:forEach> */
});


function submitForm(param){
    //设置ajax全局同步
    
	//var data = JSON.stringify(grid.getData());
	var data = grid.getData();
	var dl=grid.getDeleted();
	if(data.length==0){
		$.dialog.alert("请选择申请物料");
   	 	return false;
	}
	var ba=true;
	if(data !=null){
		var i=0;
		$(data).each(function (){
			i++;
				if(this.jbadCount == null || this.jbadCount.length<=0){
					this.jbadCount = 0;
				}
				if((parseFloat(this.jreturnquantity)+parseFloat(this.jbadCount))>parseFloat(this.jhealthycount)){
					$.dialog.alert("您第" + i + "的退货数量大于单据的入库数量");
					ba = false;
					return false;
				}
				if(this.returnquantity<=0){
					$.dialog.alert("您第" + i + "行的退货数量不能小于等于0");
					ba = false;
					return false;
				}
				if (isNaN(this.returnquantity) ||this.returnquantity==undefined ||this.returnquantity==null) {
					ba = false;
					$.dialog.alert("您第" + i + "行的退货数量没有填写");
					return false;
				}
			});
		}
		jQuery.ajaxSettings.async = false;
		if(param==3){
			getDG().dialog({content: "是否审核完结请选择(Yes或者No)!",width: 250,lock: true,max: false,min: false,
				title:'Confirm Infor',
				button: [
				         {
				             name: 'Yes',
				             callback: function(){
					            	if (ba) {
					         			$("#type").val(param);
					         			$("#itemdata").val(JSON.stringify(data));
					         			$("#itemdelete").val(JSON.stringify(dl));
					         			$("#submitFlag").val(param);
					         			$("#inputForm").submit();
					         		}
					            }
				         },
				         {
				        	   name: 'No',
				        	   focus: true
				         }             
				     ]
			}).zindex();
			}else{
				if (ba) {
					$("#type").val(param);
					$("#itemdata").val(JSON.stringify(data));
					$("#itemdelete").val(JSON.stringify(dl));
					$("#submitFlag").val(param);
					$("#inputForm").submit();
				}
			}
		
	}

	function deleteRow() {
		grid.deleteSelectedRow();
	}
	
// 	function bhcheck(){
// 		if($("#id").val()==""){
// 			$.dialog.alert("没有提交无法驳回");
// 			return false;
// 		}
// 		$.ajax({
// 	      	url: "${ctx}/yd/logic/poreturn/updateState.do",
// 	      	global: false,
// 	      	type: "POST",
// 	     	dataType: "json",
// 	      	data: ({
// 	    	  	rows : $("#id").val()
// 	      	}),		     
// 	      	success: function(msg){
// 	    	  	if(msg.msg=="SUCCESS"){
// 	    		  	$.dialog.alert("驳回成功");
// 	    	  	}
// 	    	  	if(msg.msg=="ERROR"){
// 	    		  	$.dialog.alert("驳回失败");
// 	    	  	}
// 	    	  	CloseDialog();
// 	    	  	var api = frameElement.api;
// 	         	var W = api.opener;
// 	            W.searchAP();
// 	   		}
// 		});
// 	}
function ItemWindow(rc,index) {
 	//alert("rc:"+rc+"明细:"+rc.toSource());
 	var manager = $("#table1").ligerGetGridManager();
// 	alert("'sdsadsadsdL:'"+manager.getRow(rc.__index).updstatus)
		getDG().dialog(
				{
					title : '批次管理',
					width : 650,
					height : 350,
					content : 'url:' + sys_context+ '/yd/logic/poreturn/itemManager.do?data='+encodeURIComponent(JSON.stringify(manager.getRow(rc.__index)))+'&billstatus=${poreturn.billstatus}&updstatus='+manager.getRow(rc.__index).updstatus,//
					lock : true,
					max : true,
					min : true,
					ok : function() {
						this.content.yz();
						if(this.content.ba){
						var dt = this.content.grid.getData();
						if (dt != null) {
							rc.jreturnquantity=this.content.jnum;
							rc.returnquantity=this.content.num;
							rc.itemBatch=JSON.stringify(dt);
							rc.updstatus=1;
							grid.updateCell('jreturnquantity', rc.jreturnquantity, manager.getRow(rc.__index));
							grid.updateCell('returnquantity', rc.returnquantity, manager.getRow(rc.__index));
							grid.updateCell('val', rc.returnquantity, manager.getRow(rc.__index));
							grid.updateCell('itemBatch',rc.itemBatch, manager.getRow(rc.__index));
							grid.updateCell('updstatus',rc.updstatus, manager.getRow(rc.__index));
							grid.updateRow(manager.getRow(rc.__index));
							this.content.Close();
							}else{
								this.content.Close();
							}
							
						}
						return false;
					},
					cancelVal : '关闭',
					cancel : true
				}).zindex();
	}
function exportAP(){
	var id=$("#id").val();
	if(id!=""){
		var path = basic_Url+"/exportExcel.do?id="+id;
   		window.open(path,"_blank");
	}
	else{
		$.dialog.alert("请先保存再导出");
	}
}
</script>

</head>

<body>

<form id="inputForm" action="" method="post">
<input type="hidden" id="id" name="id" value="${poreturn.id}"/>
<input type="hidden" id="itemdata" name="itemdata" value=""/>
<input type="hidden" id="itemdelete" name="itemdelete" value=""/>
<input type="hidden" id="type" name="type" value=""/>
<!-- <input type="hidden" id="unitconvert" name="unitconvert" value=""/> -->
<!-- 用于标识提交按钮 -->
<input type="hidden" id="submitFlag" value="" />
 <div class="pageContent" >
    <div class="panel">
         <table class="TableBlock" align="center">
         		<c:if test="${not empty poreturn.returnpocode }">
	                   <tr>
	                    <td nowrap>退货单据编号:</td>
	   		                 <td>
	   		                <input type="text" id="returnpocode" name="returnpocode"  readonly="readonly" class="required inp_width_98p" value="${poreturn.returnpocode}" />
	   		                 </td>
	   		                 <td colspan="2"></td>
	   		           </tr>
   		           </c:if>
   		           <tr>
   		           	<c:choose>
   		           		<c:when test="${empty poreturn.pocode}">
   		           			<td nowrap>采购编号:</td>
	                    	<td>
	                    	<select id="pocode" name="pocode" class="required inp_width_98p">
	   		                 	<option></option>
	   		                 	<c:forEach items='${polist}' var='state'>
	   		                 		<option id="${ state.pocode}" value='${state.pocode}'>${state.pocode}</option>
	   		                 	</c:forEach>
	   		                 	</select>
	   		                 	<script type="text/javascript">
	   		                		 $("#pocode").val('${poreturn.pocode}');
	   		                 	</script>
	   		                 </td>
   		           		</c:when>
   		           		<c:otherwise>
   		           		<td nowrap>采购编号:</td>
   		           			 <td>
   		                 	<input type="text" class="inp_width_98p" id="pocode" name="pocode" readonly="readonly" value="${poreturn.pocode}"/>
   		                	 </td>
   		           		</c:otherwise>
   		           	</c:choose>
   		           
   		           
   		           
   		           	<c:choose>
   		           		<c:when test="${empty poreturn.pocode}">
   		           			<td nowrap>采购入库单号:</td>
	                    	<td>
	                    	<select id="powarecode" name="powarecode" class="required inp_width_98p">
	   		                 	<option></option>
	   		                 	</select>
	   		                 	<script type="text/javascript">
	   		                		 $("#powarecode").val('${poreturn.powarecode}');
	   		                 	</script>
	   		                </td>
   		           		</c:when>
   		           		<c:otherwise>
   		           		<td nowrap>采购入库单号:</td>
   		           			 <td>
   		                 	<input type="text" class="inp_width_98p" id="powarecode" readonly="readonly" name="powarecode" value="${poreturn.powarecode}"/>
   		                 	</td>
   		           		</c:otherwise>
   		           	</c:choose>
   		                 
   		                 
   		           </tr>
   		           
   		           <tr>
<!--    		           <td nowrap>供应商:</td> -->
<!--    		                  <td> -->
<%--    		                <input type="text" id="spname" readonly="readonly" name="spname" class="required" value="${poreturn.spname}" /> --%>
<%--    		                <input type="hidden" id="spcode" readonly="readonly" name="spcode"  value="${poreturn.spcode}" /> --%>
<!--    		                 </td> -->
   		           
<!--    		                <td nowrap>批次:</td> -->
<!--    		                  <td> -->
<%--    		                <input type="text" id="batch" name="batch" readonly="readonly" class="required" value="${poreturn.batch}" /> --%>
<!--    		                 </td> -->
					<td nowrap>供应商:</td>
   		                  <td>
   		                <input type="text" id="spname" readonly="readonly" name="spname" class="required inp_width_98p" value="${poreturn.spname}" />
   		                <input type="hidden" id="spcode" readonly="readonly" name="spcode"  value="${poreturn.spcode}" class="inp_width_98p"/>
   		             </td>
   		                 
   		            <td nowrap>退货日期:</td>
   		                 <td>
   		               		 <input type="text" id="thrq" name="thrq" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="required inp_width_98p" value="<fmt:formatDate value="${poreturn.thrq}" pattern="yyyy-MM-dd" type="both" />"  readonly="readonly"/>
   		                	 <c:if test="${poreturn.thrq == null}">
								<script>
									var date = new Date();
									$("#thrq").val(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate());
								</script>
							</c:if>
   		                 </td>
   		           </tr>
   		           
   		           
   		            <tr>
   		             <td nowrap>退货仓库:</td>
                    	<td><select id="storage" name="storage" class="required inp_width_98p">
   		                 	<option></option>
   		                 	<c:forEach items='${wh}' var='state'>
   		                 	<option id="${ state.code}" value='${state.code}'>${state.name}</option>
   		                 	</c:forEach>
   		                 	</select>
   		                 	<input type="hidden" id="whcode" name="whcode" value="${poreturn.whcode}"/>
   		                 	<input type="hidden" id="whname" name="whname" value="${poreturn.whname}"/>
   		                 	<script type="text/javascript">
   		                		 $("#"+'${poreturn.whcode}').attr("selected","selected");
   		                 	</script></td>
   		            
   		                  <td nowrap>制单人:</td>
   		                  <td>
   		                <input type="text" id="createname" name="createname" class="required inp_width_98p" readonly="readonly" value="${poreturn.createname}" />
   		                 </td>
   		           </tr>
   		           
   		           
   		           <tr>
   		           	<td nowrap>备注:</td>
   		           	<td colspan="3"><input id="remark" name="remark" class="inp_width_98p" value="${poreturn.remark}" /></td>
   		           </tr>
                </table>
                <div id="table1"> </div>               
         </div>
<!--          <div class="formBar"> -->
<!-- 	        <ul> -->
<!-- 		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save" onclick="submitForm(1)">保存</button></div></div></li> -->
<!-- 		       <li><div class="button"><div class="buttonContent"><button type="button" class="print" onclick="CloseDialog()">关闭</button></div></div></li> -->
<!-- 	        </ul> -->
<!--         </div>     -->
<div class="formBar">
	        <ul>
	        	<li><div class="button"><div class="buttonContent"><button type="button" id="excel" class="export" onclick="exportAP()">导出</button></div></div> </li>
		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save" onclick="submitForm(0)">保存</button></div></div></li>
		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save1" onclick="submitForm(1)">提交</button></div></div></li>
		       <webres:displaycontroller elementId="CGRKTH_BH_CHEECK_PH" description="采购退货申请驳回">
		       		<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="bohui" onclick="submitForm('bh')">驳回</button></div></div></li>
		      	</webres:displaycontroller>
		       <webres:displaycontroller elementId="CGRKTH_YJ_CHEECK" description="采购退货二级审核">
		       			<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save2" onclick="submitForm(2)">二级审核</button></div></div></li>
		       			<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="savej2" onclick="submitForm(3)">二级审核完结</button></div></div></li>
		      		</webres:displaycontroller>
		      		<webres:displaycontroller elementId="CGRKTH_EJ_CHEECK" description="采购退货三级审核">
		       			<li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save3" onclick="submitForm(3)">三级审核</button></div></div></li>
		      		</webres:displaycontroller>
		       <li><div class="button"><div class="buttonContent"><button type="button" class="print" onclick="CloseDialog()">关闭</button></div></div></li>
	        </ul>
        </div>
    </div>
</form>
</body>
</html>
